<?php
namespace app\admin\controller\feedback;
use app\admin\controller\Controller;
use app\common\model\feedback\FeedbackAgent;

/** 商户反馈的消息
 * Class Agent
 * @package app\admin\controller\feedback
 */
class Agent extends  Controller
{

    public function index()
    {
        $model = new FeedbackAgent();
        $list = $model->getList();
        return $this->fetch('index', compact('list'));
    }

    /**
     * 修改会员等级
     * @param $id
     * @return array|bool
     * @throws \think\Exception
     * @throws \think\exception\DbException
     */
    public function grade($id)
    {

        // 用户详情
        $model = new FeedbackAgent();

        if ($model->updateRemark($id,$this->postData('grade'))) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: '操作失败');
    }

}